/*
 * @Author: wangwei wwdqq7@qq.com
 * @Date: 2025-04-01 15:25:00
 * @LastEditors: wangwei wwdqq7@qq.com
 * @LastEditTime: 2025-04-01 15:25:00
 * @FilePath: /FullStack/pro/typeorm-mysql/src/dto/role.dto.ts
 * @Description: 角色DTO，定义角色相关请求和响应的数据结构
 */
import { ApiProperty } from '@nestjs/swagger';

export class CreateRoleDto {
  @ApiProperty({
    description: '角色名称',
    example: '管理员',
    required: true,
  })
  name: string;

  @ApiProperty({
    description: '角色描述',
    example: '系统管理员，拥有所有权限',
    required: false,
  })
  description?: string;
}

export class UpdateRoleDto {
  @ApiProperty({
    description: '角色名称',
    example: '管理员',
    required: false,
  })
  name?: string;

  @ApiProperty({
    description: '角色描述',
    example: '系统管理员，拥有所有权限',
    required: false,
  })
  description?: string;
}

export class RoleResponseDto {
  @ApiProperty({
    description: '角色ID',
    example: 1,
  })
  id: number;

  @ApiProperty({
    description: '角色名称',
    example: '管理员',
  })
  name: string;

  @ApiProperty({
    description: '角色描述',
    example: '系统管理员，拥有所有权限',
  })
  description: string;

  @ApiProperty({
    description: '创建时间',
    example: '2025-04-01T15:25:00.000Z',
  })
  createdAt: Date;

  @ApiProperty({
    description: '更新时间',
    example: '2025-04-01T15:25:00.000Z',
  })
  updatedAt: Date;
}
